#pragma once

#include "CelestialBodyInfo.hpp"
#include "WorkerData.hpp"

#include "Namespaces.h"

ref class nBodyPhysicsScenarioModule : public ScenarioModule {
	private:
		array<CelestialBodyInfo ^> ^m_Bodies;
		
		// Workaround for not being allowed to declare it as static within FixedUpdate()
		array<double> ^m_Times;
		array<WorkerData ^> ^m_UpdateBodyTimesData;
		array<ManualResetEvent ^> ^m_UpdateBodyTimesResetEvent;

	public:
		nBodyPhysicsScenarioModule(void);

		void Start(void);
		void FixedUpdate(void);
		void OnDestroy(void);

	private:
		void Worker_UpdateBodyTimes(object ^Data);
		void Worker_ProcessVessel(object ^Data);

};

